<% if controller.controller_name == 'ticket' && controller.action_name == 'show' -%>
	[<%= link_to 'Overview' , :controller => 'project', :action => 'show', :project => @id, :list_type => session[:list_type], :sort => session[:list_sort] %>]
<% else -%>
	[<%= link_to 'Overview' , :controller => 'project', :action => 'show', :project => @id, :list_type => 'active' %>] 
<% end -%>

[<%= link_to 'New Ticket', :controller => 'ticket', :action => 'new', :project => @id %>]
[<%= link_to 'User List', :controller => 'project', :action => 'userlist', :project => @id %>]
[<%= link_to 'Tags', :controller => 'project', :project => @id, :action => 'tag', :tag => '' %>]

<% if controller.controller_name == 'project' %>
	[<%= link_to 'Print', :controller => 'project', :action => 'print', :project => @id %>]
<% end -%>

<% if controller.controller_name == 'project' && controller.action_name == 'show' -%>
	[View: <%= select 'options', 'list_type', Ticket.list_types, {:selected=>params[:list_type]}, {:onChange => "location.href='/project/"+ @id.to_s + "/show/'+this.value;"} %>]
<% end -%>

<% if controller.action_name != 'show' and controller.action_name != 'new' and controller.action_name != 'create' and controller.action_name != 'update' and (!@ticket.nil? or !@ticket_reply.nil?)%>
	<% if not @ticket_reply.nil? 
		@ticket_id = @ticket_reply.ticket.id
	else 
		@ticket_id = @ticket.id
	end -%>
	[<%= link_to 'show', :controller => 'ticket', :action => 'show', :id => @ticket_id %>]
<% end -%>

